package com.aspose.cells.a.f;

import com.aspose.cells.b.a.d.zm;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public class zj extends zm {
   private ZipOutputStream a;
   private zm b;
   private zh c;
   private boolean d = false;

   public zj(zm var1) throws Exception {
      this.b = var1;
      this.a = new ZipOutputStream(var1.j());
   }

   public InputStream g() throws Exception {
      return null;
   }

   public OutputStream j() throws Exception {
      return this.a;
   }

   public boolean d() {
      return false;
   }

   public boolean e() {
      return false;
   }

   public boolean f() {
      return true;
   }

   public long h() throws IOException {
      throw new UnsupportedOperationException("getLength() is not supported.");
   }

   public long i() throws Exception {
      return this.b.i();
   }

   public void b(long var1) throws Exception {
      this.b.b(var1);
   }

   public long a(long var1, int var3) throws Exception {
      throw new UnsupportedOperationException("seek() is not supported.");
   }

   public void a(long var1) throws Exception {
      throw new UnsupportedOperationException("setLength() is not supported.");
   }

   public int a(byte[] var1, int var2, int var3) throws Exception {
      throw new UnsupportedOperationException("read() is not supported.");
   }

   public void a(zh var1) throws Exception {
      if (this.d) {
         if (this.c != var1) {
            this.a.putNextEntry(this.b(this.c));
            this.a.closeEntry();
         }

         this.d = false;
      }

      this.a.putNextEntry(this.b(var1));
   }

   public zh a(String var1) {
      this.c = new zh(var1);
      this.d = true;
      return this.c;
   }

   public void a(byte var1) throws Exception {
      if (this.d) {
         this.a.putNextEntry(this.b(this.c));
         this.d = false;
      }

      this.a.write(var1);
   }

   public void b(byte[] var1, int var2, int var3) throws Exception {
      if (var3 >= 0) {
         if (this.d) {
            this.a.putNextEntry(this.b(this.c));
            this.d = false;
         }

         this.a.write(var1, var2, var3);
      }
   }

   public int c() throws Exception {
      throw new IllegalStateException("You must override the method in child classes.");
   }

   public void b() throws Exception {
      this.a.flush();
   }

   public void f_() throws Exception {
      this.a.flush();
      this.a.finish();
   }

   public void a() throws Exception {
      this.a.close();
   }

   public void a(int var1) {
      this.a.setLevel(var1);
   }

   public void b(int var1) {
      this.a.setLevel(var1);
   }

   public void c(int var1) {
   }

   public void d(int var1) {
   }

   private ZipEntry b(zh var1) {
      ZipEntry var2 = new ZipEntry(var1.b());
      var2.setSize(var1.a());
      if (var1.d() != null) {
         var2.setTime(com.aspose.cells.b.b.za.a(var1.d()));
      }

      return var2;
   }

   public void l() throws IOException {
      this.a.closeEntry();
   }
}
